package io.renren.sf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.sf.dao.BookRightDao;
import io.renren.sf.entity.BookRightEntity;
import io.renren.sf.service.BookRightService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("bookRightService")
public class BookRightServiceImpl extends ServiceImpl<BookRightDao, BookRightEntity> implements BookRightService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<BookRightEntity> page = this.page(
                new Query<BookRightEntity>().getPage(params),
                new QueryWrapper<BookRightEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<Long> getRoleRightsById(Long id) {
        return this.baseMapper.getRoleRightsById(id);
    }

    @Override
    public List<Long> getRoleStiffRightsById(Long id) {
        return this.baseMapper.getRoleStiffRightsById(id);
    }

    @Override
    public List<Long> getRoleBookExpandRightsById(Long id) {
        return this.baseMapper.getRoleBookExpandRightsById(id);
    }

    @Override
    public List<Long> getRoleStiffBookExpandRightsById(Long id) {
        return this.baseMapper.getRoleStiffBookExpandRightsById(id);
    }
}